package com.xx.ch05.demo.dmeo16;
import com.xx.ch05.demo.dmeo16.entity.User;
import com.xx.ch05.demo.dmeo16.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 许欣
 * 时间：2022/4/11 16:41
 * 描述：
 */
class test {
    @Test
    public void aopTest(){
        ApplicationContext context=new ClassPathXmlApplicationContext("Spring.xml");
        UserService service=(UserService)context.getBean("userService");
        User user=new User();
        user.setId(1);
        user.setUsername("test");
        user.setPassword("123456");
        user.setEmail("text@qwsd.com");
        service.save(user);
    }
}
